#ifndef __OS_TICKS_h_
#define __OS_TICKS_H_
#include "usr_def.h"

void delay_ms(uint16_t ms);
void Timer0_Init(void);
extern volatile unsigned long msTick;
#define millis() msTick
typedef uint32_t time_ms;
#define DECLARE_TASK_PERIOD(NAME, PERIOD) \
    static uint16_t NAME##_period = PERIOD;  \
    static time_ms NAME##_time = 0
#define CHECK_TASK_PERIOD_MS(NAME) if (millis() >= (NAME##_period + NAME##_time))
#define UPDATE_TASK_TIME_MS(NAME) NAME##_time = millis()

#endif /* __OS_TICKS_h_ */